import React from "react"
import Suit from "./suit"
@Suit
class Sima extends React.Component {
    state = {
        name: "大司马",
        age: 35,
        hobby: "你皮，你皮，任你皮",
        nickname: "芜湖大司马"
    }
    shit=()=>{
        alert("究极激光炮，发射！")
    }
    render() {
        let { skill, weapon, nickname ,attack} = this.props
        return (
            <fieldset>
                <legend>大司马</legend>
                <h1>姓名： {this.state.name}</h1>
                <h1>年龄：{this.state.age}</h1>
                <h1>昵称：{nickname?nickname:this.state.nickname}</h1>
                <h1>爱好： {this.state.hobby}</h1>
                <h1>技能：{skill ? skill : "三位一体打野"}</h1>
                <h1>武器：{weapon ? weapon : "走位，走位，手里干"}</h1>
                <button onClick={()=>{
                    if(attack){
                        attack()
                    }else{
                        this.shit()
                    }
                }}>点击发起技能打击</button>
            </fieldset>
        )
    }
}
export default Sima